name: OPI | Конвертация OPI -> OInt -> CLI

# Controls when the workflow will run
on: 
  [workflow_dispatch]
  
jobs:

  Convert:
    runs-on: ubuntu-latest
    permissions: 
      actions: write
      contents: write
     
    steps:
    
      - uses: actions/checkout@v2  
        with:
          token: ${{secrets.TOKEN}}   
                 
      - uses: otymko/setup-onescript@v1.4
        with:
          version: 1.9.0 

      - name: Установить зависимости
        run: |
          opm install cmdline
          opm install asserts
          opm install osparser
          opm install coloratos

      - name: Выполнить скрипт преобразования OPI -> OInt
        run: oscript ./.github/workflows/os/convert.os

      - name: Обновить словари
        run: oscript ./.github/workflows/os/oint_dictionary.os

      - name: Выполнить скрипт локализации
        run: oscript ./.github/workflows/os/opi_translate.os

      - name: Выполнить скрипт парсинга CLI
        run: oscript ./.github/workflows/os/cli_parse.os

      - name: Обновить Workflow тестирования OInt
        run: oscript ./.github/workflows/os/oint_testmaker.os
        
      - name: Обновить Workflow тестирования OInt (EN)
        run: oscript ./.github/workflows/os/oint_testmaker_en.os


      - uses: stefanzweifel/git-auto-commit-action@v5 
        with:
          commit_user_name: Vitaly the Alpaca (bot) 
          commit_user_email: vitaly.the.alpaca@gmail.com
          commit_author: Vitaly the Alpaca <vitaly.the.alpaca@gmail.com>
          commit_message: Преобразование OPI -> OInt (workflow)


